﻿#include <xparameters.h>
#include <xparameters_ps.h>

#include <iostream>

#include "ZShell/ZShell.h"
#include "Common/ZSingleton.hpp"
#include "FreeRTOS.h"
#include "log.h"
#include "task.h"

int main() {
  // 创建接收任务
  xTaskCreate([](void *) {
    ZSingleton<ZShell>::generate(
        XPAR_PS7_UART_0_DEVICE_ID,
        XPAR_SCUGIC_SINGLE_DEVICE_ID,
        XPAR_XUARTPS_0_INTR
        );

    while (true) {
      ZSingleton<ZShell>::instance()->runOnce();
    }
  }, "shellTask", configMINIMAL_STACK_SIZE, NULL, 4, NULL);

  // 启动调度器
  vTaskStartScheduler();

  logInfo("system exit");
}